<?php

/**
 * This is the model class for table "produksiikanlaut2".
 *
 * The followings are the available columns in table 'produksiikanlaut2':
 * @property integer $pil2_id
 * @property string $pil2_jenis
 * @property double $pil2_1_produksi
 * @property double $pil2_1_nilai
 * @property double $pil2_2_produksi
 * @property double $pil2_2_nilai
 * @property double $pil2_3_produksi
 * @property double $pil2_3_nilai
 * @property double $pil2_4_produksi
 * @property double $pil2_4_nilai
 * @property integer $pil2_tahun
 */
class Produksiikanlaut2 extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Produksiikanlaut2 the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'produksiikanlaut2';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('pil2_tahun', 'numerical', 'integerOnly'=>true),
			array('pil2_1_produksi, pil2_1_nilai, pil2_2_produksi, pil2_2_nilai, pil2_3_produksi, pil2_3_nilai, pil2_4_produksi, pil2_4_nilai', 'numerical'),
			array('pil2_jenis', 'length', 'max'=>64),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('pil2_id, pil2_jenis, pil2_1_produksi, pil2_1_nilai, pil2_2_produksi, pil2_2_nilai, pil2_3_produksi, pil2_3_nilai, pil2_4_produksi, pil2_4_nilai, pil2_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'pil2_id' => 'Pil2',
			'pil2_jenis' => 'Pil2 Jenis',
			'pil2_1_produksi' => 'Pil2 1 Produksi',
			'pil2_1_nilai' => 'Pil2 1 Nilai',
			'pil2_2_produksi' => 'Pil2 2 Produksi',
			'pil2_2_nilai' => 'Pil2 2 Nilai',
			'pil2_3_produksi' => 'Pil2 3 Produksi',
			'pil2_3_nilai' => 'Pil2 3 Nilai',
			'pil2_4_produksi' => 'Pil2 4 Produksi',
			'pil2_4_nilai' => 'Pil2 4 Nilai',
			'pil2_tahun' => 'Pil2 Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('pil2_id',$this->pil2_id);
		$criteria->compare('pil2_jenis',$this->pil2_jenis,true);
		$criteria->compare('pil2_1_produksi',$this->pil2_1_produksi);
		$criteria->compare('pil2_1_nilai',$this->pil2_1_nilai);
		$criteria->compare('pil2_2_produksi',$this->pil2_2_produksi);
		$criteria->compare('pil2_2_nilai',$this->pil2_2_nilai);
		$criteria->compare('pil2_3_produksi',$this->pil2_3_produksi);
		$criteria->compare('pil2_3_nilai',$this->pil2_3_nilai);
		$criteria->compare('pil2_4_produksi',$this->pil2_4_produksi);
		$criteria->compare('pil2_4_nilai',$this->pil2_4_nilai);
		$criteria->compare('pil2_tahun',$this->pil2_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}